/*
 * @Author: xcl
 * @Date: 2022-08-23 11:22:18
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-10-08 16:28:43
 * @Description: Cesium 三维地球可视化 - 自定义配置
 */

/** 配置项 */
const opt = {
  inspector: false, // Inspector面板，可以显示Primitive的坐标轴、边界球等信息，还可以显示网格坐标系信息等
  debug: true, // 开发环境下，开启调式和打印功能
  fps: true, // 帧数，监听查看渲染性能
  saveCamera: true, // 获取、打印相机相关参数，view值的来源
  globeBaseColor: {
    r: 27,
    g: 126,
    b: 167,
    a: 1
  }, // 球体globe的颜色 / 全局的颜色
  // longitude,latitude,height,heading,pitch,roll
  view: "108.9498687298145,34.366341946514545,1627.423896875213,352.9273975440507,-88.48816732623489,0",
};

/** 影像图层数据1 - 通过imageryFunction的方式加载影像图层 */
const mapImageData1 = [
  {
    type: "Amap",
    name: '高德地图-影像底图',
    isShow: false
  },
  {
    type: "Baidu",
    name: '百度地图-自定义0',
    isShow: true
  }
]
/** 影像图层数据2 - 通过setConfigMapList的方式加载影像图层 */
const mapImageData2 = [
  {
      "id": 3,
      "isShow": true,
      "name": "高德地图02",
      "type": "UrlTemplateImageryProvider",
      "classConfig": {
          "url": "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"
      },
      "interfaceConfig": {},
      "offset": "0,0",
      "invertswitch": 0,
      "filterRGB": "#ffffff",
      "showswitch": 1,
      "weigh": 0,
      "createtime": 1624346908,
      "updatetime": 1647395260
  },
  {
      "id": 14,
      "isShow": true,
      "name": "高德地图01",
      "type": "UrlTemplateImageryProvider",
      "classConfig": {
          "url": "http://webst03.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&style=7"
      },
      "interfaceConfig": {
          "saturation": 0,// 饱和度
          "brightness": 0.6,// 亮度
          "contrast": 1.8,// 对比度
          "hue": 1,// 色调
          "gamma": 0.3// 伽马校正
      },
      "offset": "0,0",// 偏移量
      "invertswitch": 1,// 是否反色 1 \ 0
      "filterRGB": "#2667bd",// 滤镜颜色
      "showswitch": 1,
      "weigh": 0,
      "createtime": 1624326728,
      "updatetime": 1646979297
  }
]

/** 3D 白膜数据 */
const tileset = [
  {
      "id": 4,
      "name": "深圳南山区大街道",
      "url": "https://mapv-data.oss-cn-hangzhou.aliyuncs.com/titleset/sz_ns2/tileset.json",
      // "name": "深圳",
      // "url": "http://211.149.185.229:8081/data/buildmapping/tileset.json",
      // "name": "上海",
      // "url": "https://lab.earthsdk.com/model/702aa950d03c11e99f7ddd77cbe22fea/tileset.json",
      "offset_x": 0,// 偏移量lon经度
      "offset_y": 0,// 偏移量lat纬度
      "offset_z": 0,// 偏移量height高度(米)
      "onswitch": 1,
      "flytoswitch": 1,// 摄像头是否切到到白膜的位置 0 / 1
      "color": "rgba(255, 255, 255, 1)",// 白膜颜色 默认rgba(255,255,255,1)
      "effectswitch": 1,// 是否启用打光效果 0 / 1
      "height": 260,// 光环的移动范围(高度)单位米
      "effect_color": "#df16f1",// 打光效果颜色
      "createtime": 1626347087,
      "updatetime": 1637372783
  }
]

const CesiumGlobeConfig =  {
  cesiumContainerId: 'MAPContainer',
  loadingIndicatorId: 'my-loading-mask',
  opt: opt,
  mapImageData1: mapImageData1,
  mapImageData2: mapImageData2,
  tileset: tileset,
};

window.CesiumGlobeConfig = CesiumGlobeConfig;